TRowAddAfterMenuItemDispatcher.getMenuItem   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
c 0
b 0
f 0
dl 11
loc 11
rs 10
1 View Code Duplication
import { addRowAfter } from 'prosemirror-tables';
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2
import AbstractMenuItemDispatcher from './AbstractMenuItemDispatcher';
3
import { svgIcon } from '../MDI';
4
import MenuItem from '../MenuItem';
5
6
export default class TRowAddAfterMenuItemDispatcher extends AbstractMenuItemDispatcher {
7
    static isAvailable(schema) {
8
        return !!schema.nodes.table;
9
    }
10
11
    static getMenuItem(schema) {
12
        if (!this.isAvailable(schema)) {
13
            throw new Error('Table not available in schema!');
14
        }
15
16
        return new MenuItem({
17
            command: addRowAfter,
18
            icon: svgIcon('table-row-plus-after'),
19
            label: LANG.plugins.prosemirror['label:table-add-row-after'],
0 ignored issues
show
Bug introduced by
The variable LANG seems to be never declared. If this is a global, consider adding a /** global: LANG */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
20
        });
21
    }
22
}
23